import json
import datetime
class CMessage:
    Name = 'eRepairWeb'
    def __init__(self, name=None, status=None, exception=None):
        self.SetOption(name, status, exception)
    
    def SetOption(self, name, status, exception):
        self.name = name
        self.status = status
        self.exception = exception
    def ToJson(self):
        return json.dumps({"name":self.name, "status":self.status, "exception":self.exception})

class CDateTran:
    __s_date=datetime.date(1899,12,31).toordinal()-1
    def __init__(self):
        self.standard_date = CDateTran.__s_date
    def getdate(self, date):
        if len(str(date))<1:
            return None
        if isinstance(date,float):
            date=int(date)
        d = datetime.date.fromordinal(CDateTran.__s_date+date)
        return d.strftime("%Y-%m-%d")
    
        